package com.fcscs.cservice.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.fcscs.cservice.common.CServiceCommonEnums.ModuleEnum;
import com.fcscs.cservice.common.CServiceCommonEnums.UpdateVerLevelEnum;
import com.fcscs.cservice.common.CServiceCommonEnums.VersionEntityTypeEnum;
import com.fcscs.cservice.common.CServiceCommonEnums.VersionTypeEnum;
import com.fcscs.cservice.domain.VersionUpdates;
import com.fcscs.cservice.domain.Versions;
import com.fcscs.cservice.domain.model.VersionView;

@Repository
public interface ECMSVersionDao {

	List<Versions> getVersions(long orgId, long propId, ModuleEnum module, VersionTypeEnum versionType, VersionEntityTypeEnum entityType);

	Versions getVersion(long id);
	
	Versions saveVersion(Versions ver);

	VersionUpdates saveVersionUpdates(VersionUpdates vu);
	
	boolean deleteVersion(Versions ver);
	
	boolean deleteVersionUpdates(VersionUpdates vu);
	
	boolean permDeleteVersion(Versions ver);
	
	boolean permDeleteVersionUpdates(VersionUpdates vu);
	
	boolean invalidateVersion(Versions ver, VersionTypeEnum setToType, boolean isCurrent);
	
	boolean isVersionTaken(long orgId, long propId, ModuleEnum module, VersionTypeEnum versionType, VersionEntityTypeEnum entityType, String name, Long id);

	boolean isVersionUpdatesTaken(long orgId, long propId, ModuleEnum moduleEnum, VersionEntityTypeEnum entityTypeEnum, Long entityId, Long id);
	
	List<Versions> getExpiredVersionList(long orgId, long propId);

	List<VersionView> getVersionViewList(long orgId, long propId, ModuleEnum module, List<VersionView> verList);

	void updateVersionValues(long orgId, long propId, ModuleEnum module, VersionEntityTypeEnum entityType, Long entityId, UpdateVerLevelEnum level);
	
	Versions getCurrentVersion(long orgId, long propId, ModuleEnum module, VersionEntityTypeEnum entityType);
	
	Versions getScheduledVersion(long orgId, long propId, ModuleEnum module, VersionEntityTypeEnum entityType);

	Versions getVersion(long orgId, long propId, ModuleEnum module, VersionTypeEnum versionType, VersionEntityTypeEnum entityType, String name);

	List<VersionUpdates> getVersionUpdates(long orgId, long propId, ModuleEnum module, VersionEntityTypeEnum entityType);
}
